package com.ymatou.auth.service;

import java.util.ArrayList;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymatou.auth.parameter.SecurityQuestion;
import com.ymatou.paymentproxy.parameter.Detail;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*获取安全问题列表Call
*FreeMaker Template自动生成代码
*/
public class GetSecurityQuestionListCall extends YmatouBaseCall{
	private static String opurl ="json/reply/GetSecurityQuestionListDto";
	
	public GetSecurityQuestionListCall() {
		super(EnvSetup.getSystemUrl("api_auth"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	/**
	 * @return
	 */
	public ArrayList<SecurityQuestion> getResult() {
		ArrayList<SecurityQuestion> result =new ArrayList<SecurityQuestion>();
		try {
			result = (ArrayList<SecurityQuestion>) new Gson().fromJson(this.getString("Result"), new TypeToken<ArrayList<SecurityQuestion>>() {}.getType());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}